<template>
	<view class="container">
		<u-toast ref="uToast" />
		<view class="list">
			<view class="layout">
				<view class="notify" v-for="(item,index) in dataList"
					@click="$toLink('../inform_detail/inform_detail',{})">
					<view class="left">
						<image :src="item.icon" mode="widthFix"></image>
						<text :class="[item.num?'':'vanish']">{{item.num}}</text>
					</view>
					<view class="right">
						<view class="top">
							<text>{{item.notify}}</text>
							<text class="iconfont icon-lajitong" style="margin-left:50rpx;"></text>
						</view>
						<view class="center">
							{{item.content}}
						</view>
						<view class="bottom">
							<text>{{item.start_date}}</text>
							<text>{{item.start_time}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import request from '../../../request.js'
	export default {
		data() {
			return {

				dataList: [{
						url: '../../static/tupian57.png',
						notify: '学校通知',
						icon: '../../static/tupian82.png',
						content: '根据教育局通知安排，元旦放假三天，与2020年12月...',
						start_date: '2019.04.03',
						start_time: '12:00:00',
						num: 5,
					},
					{
						url: '../../static/tupian57.png',
						notify: '学校通知',
						icon: '../../static/tupian83.png',
						content: '根据教育局通知安排，元旦放假三天，与2020年12月...',
						start_date: '2019.04.03',
						start_time: '12:00:00',
						num: '',
					},
					{
						url: '../../static/tupian57.png',
						notify: '学校通知',
						icon: '../../static/tupian84.png',
						content: '根据教育局通知安排，元旦放假三天，与2020年12月...',
						start_date: '2019.04.03',
						start_time: '12:00:00',
						num: 5,
					},
					{
						url: '../../static/tupian57.png',
						notify: '学校通知',
						icon: '../../static/tupian82.png',
						content: '根据教育局通知安排，元旦放假三天，与2020年12月...',
						start_date: '2019.04.03',
						start_time: '12:00:00',
						num: '',
					},
					{
						url: '../../static/tupian57.png',
						notify: '学校通知',
						icon: '../../static/tupian83.png',
						content: '根据教育局通知安排，元旦放假三天，与2020年12月...',
						start_date: '2019.04.03',
						start_time: '12:00:00',
						num: 5,
					},
					{
						url: '../../static/tupian57.png',
						notify: '学校通知',
						icon: '../../static/tupian84.png',
						content: '根据教育局通知安排，元旦放假三天，与2020年12月...',
						start_date: '2019.04.03',
						start_time: '12:00:00',
						num: '',
					},
					{
						url: '../../static/tupian57.png',
						notify: '学校通知',
						icon: '../../static/tupian82.png',
						content: '根据教育局通知安排，元旦放假三天，与2020年12月...',
						start_date: '2019.04.03',
						start_time: '12:00:00',
						num: '',
					}
				]
			}
		},
		methods: {
			getTemp() {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				request({
					url: base_url + 'teacher/school_notify/temp',
					method: 'post',
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data);
							_this.teacher_list = res.data.data;
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.container {
		width: 100%;
		height: 100vh;
		background-color: #F2F2F2;

		.topBox {
			width: 100%;
			height: 65rpx;
			background: #fff;
			position: relative;
			display: flex;
			justify-content: space-evenly;

			view {
				height: 65rpx;
				line-height: 65rpx;
				width: 120rpx;
				text-align: center;
				font-size: 30rpx;
				color: #333333;

				text {
					display: none;
				}


			}

			.con {
				position: relative;
				height: 65rpx;
				line-height: 65rpx;
				color: #4784FF;
				width: 120rpx;

				text {
					display: block !important;
					position: absolute;
					width: 120rpx;
					height: 4rpx;
					background: #4784FF;
					bottom: 0rpx;
					left: 0rpx;
				}
			}

		}

		.list {
			width: 100%;
			overflow: hidden;

			.layout {
				width: 710rpx;
				background-color: #fff;
				margin-left: 20rpx;

				.notify {
					width: 690rpx;
					margin-left: 10rpx;
					height: 155rpx;
					background-color: #fff;
					border-bottom: 1rpx solid #F2F2F2;
					display: flex;
					justify-content: flex-start;

					.left {
						width: 70rpx;
						height: 155rpx;
						margin-left: 5rpx;
						position: relative;

						image {
							&:nth-child(1) {
								position: absolute;
								width: 70rpx;
								left: 2rpx;
								top: 29rpx;
							}
						}

						text {
							&:nth-child(2) {
								width: 25rpx;
								height: 25rpx;
								border-radius: 50%;
								background-color: #f00;
								text-align: center;
								line-height: 25rpx;
								color: #fff;
								font-size: 5rpx;
								position: absolute;
								z-index: 100;
								display: block;
								right: 0rpx;
								top: 25rpx;
							}
						}

						.vanish {
							display: none !important;
						}

					}

					.right {
						width: 605rpx;
						margin-left: 10rpx;
						height: 155rpx;
						overflow: hidden;

						.top {
							width: 100%;
							height: 35rpx;
							margin-top: 29rpx;
							display: flex;
							justify-content: flex-start;

							text {
								font-size: 28rpx;
								color: #333333;

								&:nth-child(1) {
									width: 510rpx;
								}

								&:nth-child(2) {}
							}
						}

						.center {
							width: 100%;
							font-size: 24rpx;
							color: #666666;
							height: 26rpx;
							margin-top: 19rpx;
						}

						.bottom {
							width: 100%;
							height: 24rpx;
							color: #b7b7b7;
							font-size: 22rpx;
							margin-top: 12rpx;
						}

					}

					&:nth-child(1) {
						margin-top: 20rpx;
					}
				}
			}

		}
	}
</style>
